! function (win, option) {
	var count = 0,
		designWidth = option.designWidth,
		designHeight = option.designHeight || 0,
		designFontSize = option.designFontSize || 20,
		callback = option.callback || null,
		root = document.documentElement,
		body = document.body,
		rootWidth, newSize, t, self;
	root.style.width = "100%";

	function _getNewFontSize() {
		var scale = designHeight !== 0 ? Math.min(win.innerWidth / designWidth, win.innerHeight / designHeight) : win.innerWidth / designWidth;
		return parseInt(scale * 10000 * designFontSize) / 10000;
	}
	function updateRootFontSize() {
		var newSize = _getNewFontSize();
		if (newSize < 100) {
			newSize = 100
		}
		root.style.fontSize = newSize + "px";
		return callback && callback(newSize);
	};

	! function () {
		rootWidth = root.getBoundingClientRect().width;
		if (rootWidth !== win.innerWidth && count < 20) {
			win.setTimeout(function () {
				count++;
				updateRootFontSize();
			}, 0);
		} else {
			updateRootFontSize();

		};
	}();
	win.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function () {
		clearTimeout(t);
		t = setTimeout(function () {
			updateRootFontSize();
		}, 300);
	}, false);
}(window, { designWidth: 1920, designFontSize: 100, callback: function (argument) { } });
